﻿using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;

namespace 生一档傻瓜式生成器
{
    public partial class Form3: MaterialForm
    {
        public Form3()
        {
            InitializeComponent();

            // Initialize MaterialSkinManager
           
        }

        private void Form3_Load(object sender, EventArgs e)
        {

        }

        private void materialButton1_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter ="图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string jkm_file = openFileDialog.FileName;
                    jkm_1.Text = jkm_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
          
        }

        private void materialDrawer1_Click(object sender, EventArgs e)
        {

        }

        private void materialTextBox25_Click(object sender, EventArgs e)
        {

        }

        private void materialSwitch1_CheckedChanged(object sender, EventArgs e)
        {
            if (materialSwitch1.Checked == true)
            {
                xck_1.Enabled = false;
                xck_button_1.Visible = false;
            }
            else
            {
                xck_1.Enabled = true;
                xck_button_1.Visible = true;
            }
        }

        private void materialLabel3_Click(object sender, EventArgs e)
        {

        }

        private void materialButton16_Click(object sender, EventArgs e)
        {
            jindu_text.Text = "正在打开文件选择框...";
            jindu_2.Value += 2;
            Thread save = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                SaveFileDialog saveDataSend = new SaveFileDialog();
                jindu_text.Text = "正在等待用户选择保存位置";
                jindu_2.Value += 8;
                // Environment.SpecialFolder.MyDocuments 表示在我的文档中
                saveDataSend.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);   // 获取文件路径
                saveDataSend.Filter = "*.xlsx|表格文件";   // 设置文件类型为文本文件
                saveDataSend.DefaultExt = ".xlsx";   // 默认文件的拓展名
                saveDataSend.FileName = "一生一档" + name.Text+".xlsx";   // 文件默认名
                if (saveDataSend.ShowDialog() == DialogResult.OK)   // 显示文件框，并且选择文件
                {
                    string fName = saveDataSend.FileName;   // 获取文件名
                                                            // 参数1：写入文件的文件名；参数2：写入文件的内容
                    
                }
            });
            save.SetApartmentState(ApartmentState.STA);
            save.IsBackground = true;
            save.Start();
        }

        private void materialTextBox214_Click(object sender, EventArgs e)
        {

        }

        private void materialButton2_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string jkm_file = openFileDialog.FileName;
                    jkm_2.Text = jkm_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton3_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string jkm_file = openFileDialog.FileName;
                    jkm_3.Text = jkm_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton4_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string jkm_file = openFileDialog.FileName;
                    jkm_4.Text = jkm_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton5_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string jkm_file = openFileDialog.FileName;
                    jkm_5.Text = jkm_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void xck_button_1_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string xck_file = openFileDialog.FileName;
                    xck_1.Text = xck_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton7_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string xck_file = openFileDialog.FileName;
                    xck_2.Text = xck_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton8_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string xck_file = openFileDialog.FileName;
                    xck_3.Text = xck_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton9_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string xck_file = openFileDialog.FileName;
                    xck_4.Text = xck_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }

        private void materialButton10_Click(object sender, EventArgs e)
        {
            Thread th = new System.Threading.Thread((System.Threading.ThreadStart)delegate
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Application.StartupPath;
                openFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\
                openFileDialog.Filter = "图像文件(.jpg;.jpg;.jpeg;.gif;.png) |.jpg;.jpeg;.gif; *.png";
                openFileDialog.RestoreDirectory = true;
                openFileDialog.FilterIndex = 1;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string xck_file = openFileDialog.FileName;
                    xck_5.Text = xck_file;
                }
            });
            th.SetApartmentState(ApartmentState.STA);
            th.IsBackground = true;
            th.Start();
        }
    }
}
